﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;

namespace TpBaseObjects.Base {
    public class ProjektRowObject {

        #region Members

        private Range myRow;
        
        #endregion

        #region Contructor

        public ProjektRowObject() {
        }

        public ProjektRowObject(Range row) {
            myRow = row;
            SetValues(this.myRow);
        }

        #endregion

        #region Properties

        public bool BildeSumme {
            get;
            set;
        }

        public Nullable<DateTime> ChangeDate {
            get;
            set;
        }

        public Double ChangeBeginTime {
            get;
            set;
        }

        public Double ChangeEndTime {
            get;
            set;
        }

        public Double ChangeFlatTime {
            get;
            set;
        }

        public Double ChangeQuantity {
            get;
            set;
        }

        public Double ChangePerformance {
            get;
            set;
        }

        public string ChangeType {
            get;
            set;
        }

        public int DeleteRowNumber {
            get;
            set;
        }

        public string Durchführender1 {
            get;
            set;
        }

        public string Durchführender2 {
            get;
            set;
        }

        public string Einheit {
            get;
            set;

        }

        public string Fahrzeug {
            get;
            set;
        }

        public string Hyperlink {
            get;
            set;
        }

        public bool IsEpRow {
            get;
            set;
        }

        public bool IsLeOrLa {
            get;
            set;
        }

        public bool IsProjectJob {
            get;
            set;
        }

        public bool IsRabattZeile {
            get;
            set;
        }

        public bool IsReadyForExport {
            get;
            set;
        }

        public bool IsReadyForJobevidenz {
            get;
            set;
        }

        public bool IsReadyForInternalJobevidenz {
            get;
            set;
        }

        public bool IsReadyToStorno {
            get;
            set;
        }

        public bool IsPauschalTime {
            get;
            set;
        }

        public bool IsSummenZeile {
            get;
            set;
        }

        public bool IsVpRow {
            get;
            set;
        }

        public DateTime JobDatum {
            get;
            set;
        }

        public bool JobExported {
            get;
            set;
        }

        public double JobTime {
            get;
            set;
        }

        public double JobEndTime {
            get;
            set;
        }

        public string KundenName {
            get;
            set;
        }

        public string Leistung {
            get;
            set;
        }

        public string JobOrt {
            get;
            set;
        }

        public bool LeistungExported {
            get;
            set;
        }

        public double LeistungProzent {
            get;
            set;
        }

        public double LeistungZeit {
            get;
            set;
        }

        public double PauschalZeit {
            get;
            set;
        }

        public double LeistungZeitSumme {
            get;
            set;
        }

        public double Menge {
            get;
            set;
        }

        public Range MyRow {
            get { return myRow; }
        }

        public string ProjectName {
            get;
            set;
        }

        public double RabattProzent {
            get;
            set;
        }

        public bool RechnungExported {
            get;
            set;
        }

        public int RechnungsNummer {
            get;
            set;
        }

        public string RowID {
            get;
            set;
        }

        public string RowLeistung {
            get;
            set;
        }

        public int RowNumber {
            get;
            set;
        }

        public string RowTerm {
            get;
            set;
        }

        public string RowText {
            get;
            set;
        }

        public string RowType {
            get;
            set;
        }

        public string S4Type {
            get;
            set;
        }

        public string Stellvertreter {
            get;
            set;
        }

        public double SummeEp {
            get;
            set;
        }

        public int SummenHierachie {
            get;
            set;
        }

        public string SummenText {
            get;
            set;
        }

        public double SummeVp {
            get;
            set;
        }

        public bool Ust {
            get;
            set;
        }

        #endregion

        #region Methods

        private void SetValues(Range row) {
            ProjectRow s = new ProjectRow(row);
            this.BildeSumme = s.BildeSumme;
            this.ChangeBeginTime = s.ChangeBeginTime;
            this.ChangeDate = s.ChangeDate;
            this.ChangeEndTime = s.ChangeEndTime;
            this.ChangeFlatTime = s.ChangeFlatTime;
            this.ChangePerformance = s.ChangePerformance;
            this.ChangeQuantity = s.ChangeQuantity;
            this.ChangeType = s.ChangeType;
            this.DeleteRowNumber = s.DeleteRowNumber;
            this.Durchführender1 = s.Durchführender1;
            this.Durchführender2 = s.Durchführender2;
            this.Einheit = s.Einheit;
            this.Fahrzeug = s.Fahrzeug;
            this.Hyperlink = s.Hyperlink;
            this.IsEpRow = s.IsEpRow;
            this.IsLeOrLa = s.IsLeOrLa;
            this.IsPauschalTime = s.IsPauschalTime;
            this.IsProjectJob = s.IsProjectJob;
            this.IsRabattZeile = s.IsRabattZeile;
            this.IsReadyForExport = s.IsReadyForExport;
            this.IsReadyForInternalJobevidenz = s.IsReadyForInternalJobevidenz;
            this.IsReadyForJobevidenz = s.IsReadyForJobevidenz;
            this.IsReadyToStorno = s.IsReadyToStorno;
            this.IsSummenZeile = s.IsSummenZeile;
            this.IsVpRow = s.IsVpRow;
            this.JobDatum = s.JobDatum;
            this.JobEndTime = s.JobEndTime;
            this.JobExported = s.JobExported;
            this.JobOrt = s.JobOrt;
            this.JobTime = s.JobTime;
            this.KundenName = s.KundenName;
            this.Leistung = s.Leistung;
            this.LeistungExported = s.LeistungExported;
            this.LeistungProzent = s.LeistungProzent;
            this.LeistungZeit = s.LeistungZeit;
            this.LeistungZeitSumme = s.LeistungZeitSumme;
            this.Menge = s.Menge;
            this.PauschalZeit = s.PauschalZeit;
            this.ProjectName = s.ProjectName;
            this.RabattProzent = s.RabattProzent;
            this.RechnungExported = s.RechnungExported;
            this.RechnungsNummer = s.RechnungsNummer;
            this.RowID = s.RowID;
            this.RowLeistung = s.RowLeistung;
            this.RowNumber = s.RowNumber;
            this.RowTerm = s.RowTerm;
            this.RowText = s.RowText;
            this.RowType = s.RowType;
            this.S4Type = s.S4Type;
            this.Stellvertreter = s.Stellvertreter;
            this.SummeEp = s.SummeEp;
            this.SummenHierachie = s.SummenHierachie;
            this.SummenText = s.SummenText;
            this.SummeVp = s.SummeVp;
            this.Ust = s.Ust;
            
        }

        #endregion

        #region Overrides

        public override bool Equals(object obj) {
            bool equals = false;
            ProjektRowObject objRow = obj as ProjektRowObject;
            if (objRow.Durchführender1 == this.Durchführender1 && objRow.Durchführender2 == this.Durchführender2
                && objRow.Einheit == this.Einheit && objRow.Fahrzeug == this.Fahrzeug
                && objRow.IsEpRow == this.IsEpRow && objRow.IsLeOrLa == this.IsLeOrLa
                && objRow.IsRabattZeile == this.IsRabattZeile && objRow.IsSummenZeile == this.IsSummenZeile
                && objRow.IsVpRow == this.IsVpRow && objRow.JobDatum == this.JobDatum
                && objRow.KundenName == this.KundenName && objRow.Leistung == this.Leistung
                && objRow.LeistungProzent == this.LeistungProzent && objRow.LeistungZeit == this.LeistungZeit
                && objRow.Menge == this.Menge && objRow.RabattProzent == this.RabattProzent
                && objRow.RowLeistung == this.RowLeistung && objRow.RowTerm == this.RowTerm
                && objRow.RowText == this.RowText && objRow.RowType == this.RowType
                && objRow.SummenText == this.SummenText) {
                equals = true;

            }
            return equals;
        }

        public override int GetHashCode() {
            return base.GetHashCode();
        }

        #endregion

    }
}
